package com.shunli.cterminal.controller;

import com.examples.core.res.CommonResult;
import com.shunli.cterminal.model.res.StyleInfoVO;
import com.shunli.cterminal.service.CollectionTemplateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: CollectionController
 * @Description: TODO
 * @Author: DAIYALU
 * @Date: 2024/11/6
 * @Version: 1.0
 */
@Tag(name = "集合页功能")
@RequiredArgsConstructor
@RestController
public class CollectionController {

    private final CollectionTemplateService templateService;

    @Operation(summary = "集合页查询(H5)")
    @GetMapping("/noAuth/collection/get")
    public CommonResult<List<StyleInfoVO>> get(@RequestParam(value = "domainName", required = true) String domainName,
                                               @RequestParam(value = "goodsType") String goodsType,
                                               @RequestParam(value = "channel", required = false) String channel) {
        return CommonResult.data(templateService.get(domainName,goodsType,channel));
    }
}
